import shareholderServ from "./shareholderServ";
Page({
    data:{
        list:[],
        modalHidden:true,
        noDataState:false
    },
    getDataList(){
        let accountId = wx.getStorageSync('userId');
        let cusmallToken = wx.getStorageSync('cusmallToken');
        let that = this;
        let {noDataState,list} = this.data
        shareholderServ.queryByAccountId({accountId,cusmallToken}).then((res)=>{
         if(res.ret==0&&res.model.list.length>0){
           noDataState = true
           list=res.model.list
         }else{
            noDataState = false
         }
         that.setData({
            list,noDataState
         })
        })
    },
    goDescribe(e){
        let { item } = e.currentTarget.dataset;
        this.setData({
            modalHidden:false,
            itemDescribe:item
        });
    },
    modalCandel(){
        this.setData({
            modalHidden:!this.data.modalHidden
        });
    },
    modalConfirm(){
        this.setData({
            modalHidden:!this.data.modalHidden
        });
    },
    clickImg(e){
        let src = e.currentTarget.dataset.src;
        //图片预览
       wx.previewImage({
          current: src, // 当前显示图片的http链接
           urls: [src] // 需要预览的图片http链接列表
        })
    },
    onShow(){
      this.getDataList();
    }
});